mod memtable;
pub use memtable::KvTable;
use std::collections::{HashMap, HashSet};

#[derive(Debug, PartialEq, Eq, Clone)]
pub enum Value {
    STRING(String),
    INTEGER(i64),
    BOOLEAN(bool),
    BIN(Vec<u8>),
    HASH(HashMap<String, String>),
    SET(HashSet<String>)
}

#[derive(Debug, PartialEq, Eq, Hash, Clone)]
pub enum Key {
    STRING(String)
}


#[derive(Debug, PartialEq, Eq)]
pub enum KvErr {
    NOTFOUND,
    DUPLICATE,
    UNEXPECTED,
}
pub trait StorageService: Send + Sync + 'static{
    fn insert(&self, k: Key, v: Value) -> Result<(), KvErr>;
    fn lookup(&self, k: Key) -> Result<Value, KvErr>;
    fn delete(&self, k: Key) -> Result<(), KvErr>;

}